package cn.iocoder.yudao.module.kt.dal.mysql.resource;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.kt.dal.dataobject.resource.ResourceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.kt.controller.admin.resource.vo.*;

/**
 * 教材分类 Mapper
 *
 * @author zhaokang
 */
@Mapper
public interface ResourceMapper extends BaseMapperX<ResourceDO> {

    default PageResult<ResourceDO> selectPage(ResourcePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResourceDO>()
                .likeIfPresent(ResourceDO::getName, reqVO.getName())
                .betweenIfPresent(ResourceDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ResourceDO::getType, reqVO.getType())
                .orderByDesc(ResourceDO::getId));
    }

}